/***************************************************************************
 *   Copyright (C) 2009 by Zheng Yonglei
 *   zhengyonglei@gmail.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef SETTINGS_H
#define SETTINGS_H

#include <QtGui/QWidget>
#include <QStandardItemModel>
#include <QHeaderView>
#include <QStandardItem>
#include <QStringList>
#include <QVector>
#include <QColorDialog>
#include <QFontDialog>
#include <QFileDialog>
#include <QDialog>

#include <vector>

#include "ui_SettingsDialog.h"
#include "types.h"
#include "WordManager.h"
#include "DictManager.h"
#include "Options.h"

class SettingsDialog : public QDialog
{
    Q_OBJECT

public:
	SettingsDialog(QDialog *parent = 0);
    ~SettingsDialog();

    void showThisDialog();
    void setRefreshInterval();
    void setDictTable();
    void updateDictList();
    void loadLanguageOptions();

public slots:
    void dictsMoveUpButtonClicked();
    void dictsMoveDownButtonClicked();
    void OKButtonClicked();
    void showMainShadingColorDialog();
    void showSelectionShadingColorDialog();
    void showProgramFontDialog();
    void showBrowserFontDialog();
    void useQSound(bool arg){ui.speakCommandEdit->setEnabled(!arg);}
    void enableForceRefresh(bool arg){ui.refreshIntervalEdit->setEnabled(arg);}
    void setSoundLibPath();

private:
    Ui::SettingsDialogClass ui;

    QStandardItemModel* mDictModel;
    QColorDialog* mMainShadingColorDialog;
    QColorDialog* mSelectiongShadingColorDialog;
    QFontDialog* mProgramFontDialog;
    QFontDialog* mBrowserFontDialog;
};

#endif // SETTINGS_H
